package com.xltt.vehicleControl.model;


import android.content.Context;

import com.xltt.vehicleControl.bean.BaseData;
import com.xltt.vehicleControl.bean.BaseResult;
import com.xltt.vehicleControl.bean.UserResponse;
import com.xltt.vehicleControl.contract.IUserContract;
import com.xltt.vehicleControl.iApiService.IUserService;
import com.xltt.vehicleControl.util.RetrofitManager;

import java.util.Map;

import io.reactivex.Observable;

public class UserModel implements IUserContract.IUserModel {


    private UserModel() {
    }

    public static UserModel getInstance() {
        return Inner.instance;
    }

    @Override
    public Observable<BaseResult<UserResponse>> loginByUserAndPassWord(Map<String, String> body) {
        return RetrofitManager.getInstance().createRs(IUserService.class).loginByUserAndPassWord(body);
    }

    @Override
    public Observable<BaseResult<BaseData>> logout() {
        return RetrofitManager.getInstance().createRs(IUserService.class).logout();
    }

    private static class Inner {
        private static final UserModel instance = new UserModel();
    }


}
